package com.blockchain.front.service.common;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.blockchain.common.enums.CertificateType;
import com.blockchain.framework.http.session.authentication.AuthenticationException;
import com.blockchain.framework.service.Service;
import com.blockchain.front.service.common.entity.User;
import com.blockchain.front.service.common.entity.UserInsert;

public abstract interface UserManage extends Service {

	/**
	 * 
	 * 描述：新增用户
	 * 
	 */
	public abstract int addUser(UserInsert user) throws Throwable;

	/**
	 * 校验是否为合法的手机号
	 */
	public boolean isNickPhone(String phone) throws Throwable;

	/**
	 * 查询用户名是否存在
	 * 
	 * @param accountName
	 *            用户名
	 * @return
	 * @throws SQLException
	 *             数据库操作异常
	 */
	public abstract boolean isAccountExists(String accountName) throws Throwable;

	/**
	 * 写日志
	 * 
	 * @param accountId
	 * @throws Throwable
	 */
	public void log(int accountId, String ip) throws Throwable;

	/**
	 * 设置交易密码
	 * 
	 * @param accountId
	 * @throws Throwable
	 */
	public void addJymm(String paypassword) throws Throwable;

	/**
	 * 实名认证
	 * 
	 * @param accountId
	 * @throws Throwable
	 */
	public void addSmrz(String name, String zjh, CertificateType certificateType) throws Throwable;

	/**
	 * 
	 * 注册信息
	 * 
	 * @param accountId
	 * @throws Throwable
	 */
	public User getUser() throws Throwable;
	
	/**
	 * 用户信息，包含btc账户资金情况
	 * @return
	 * @throws Throwable
	 */
	public User getUserBtc() throws Throwable;

	/**
	 * 读取用户ID
	 * 
	 * @param condition
	 * @param password
	 * @return
	 * @throws AuthenticationException
	 * @throws SQLException
	 */
	public int readAccountId(String condition, String password) throws AuthenticationException, SQLException;

	/**
	 * 
	 * <dt>
	 * <dl>
	 * 描述：获取当前登录用户账户名称.
	 * 
	 * @throws Throwable
	 */
	public abstract String getAccountName() throws Throwable;

	/**
	 * 查询用户是否存在
	 * 
	 * @param accountName
	 * @return
	 * @throws Throwable
	 */
	public abstract boolean isNickName(String accountName) throws Throwable;

	/**
	 * 判断手机号是否存在
	 * 
	 * @param idCard
	 * @return
	 * @throws Throwable
	 */
	public abstract boolean isPhone(String idCard) throws Throwable;

	/**
	 * 修改发送记录
	 * 
	 * @param phone
	 * @param code
	 * 
	 * @return
	 * @throws Throwable
	 */
	public abstract void updateSend(String phone, String code) throws Throwable;

	/**
	 * 查询发送记录
	 * 
	 * @param phone
	 * @param code
	 * 
	 * @return
	 * @throws Throwable
	 */
	public abstract int getSend(String phone) throws Throwable;

	/**
	 * 修改密码
	 * 
	 * @param password
	 * @throws Throwable
	 */
	public abstract void updatePassword(String password) throws Throwable;
	
	/**
	 * 是否高级实名认证
	 * 
	 * @param password
	 * @throws Throwable
	 */
	public abstract boolean gjsmrz()  throws Throwable;
	
	/**
	 * 
	 * 用户认证信息2017年8月2日15:05:36
	 * @param password
	 * @throws Throwable
	 * 2:未交易设置密码;
	 * 3：未实名认证
	 * 4：未高级实名认证
	 */
	public abstract int szxx()  throws Throwable;
	/**
	 * 获取用户的所有虚拟币的可用 和冻结数据
	 * 每个虚拟币为list的一个元素
	 * key="ID" --虚拟币ID
	 * key="usable" --可用数
	 * key="frozen" --冻结
	 * */
	public abstract List<Map<String,String>> getUserCapital() throws  Throwable;
}
